//帮助
var app = getApp()
Page({
  data: {
    shipperArray: ['德邦','安能','顺丰'],
    form: {
      freightColle: false,
      insured: false,
      internalShipper: '安能',
    },
    shipperIndex: 0,
  },
  onLoad: function (option) {
      this.order = app.HttpResource('/order/:id', { id: '@id' })
      this.setData({
        orderId: option.id
      });
  },
  submitForm(e) {
      const id = this.data.orderId
      const params = e.detail.value
      this.order.updateAsync({ id: id },params).then(data => {
					this.showToast('提交成功')
      })
  },
	showToast(message) {
		app.WxService.showToast({
			title: message,
			icon: 'success',
			duration: 1500,
		}).then(() => {
      console.log(111);
      app.WxService.switchTab({
            url: '/pages/order/index'
        })
    });
	},
  bindShipperChange: function(e) {
    this.setData({
      shipperIndex: e.detail.value,
    })
  }
})
